package com.airhockey;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;

/**
 * A GraphicObject is composed of a position and a bitmap
 * @author Maxime
 */
public class GraphicObject {
	
	/* position */
	public int [] position;
	/* bitmap */
	public Bitmap image;
	
	
	public GraphicObject()
	{
		position = new int[2];
	}
	
	public void setPosition(int x,int y)
	{
		position[0]=x;
		position[1]=y;
	}
	
	public int getX()
	{
		return position[0];
	}
	
	public int getY()
	{
		return position[1];
	}

	/* Setteur bitmap */
	public void setImage(View view,int w,int h,int id)
	{
		Bitmap img = BitmapFactory.decodeResource(view.getResources(),id);
  	    image = Bitmap.createScaledBitmap(img, w, h, true);
	}
}
